import request from '@/utils/request'

export const getRolesAPI = (params) => {
  return request.get('/sys/role', {
    params
  })
}

export const addRoleAPI = (data) => {
  return request.post('/sys/role', data)
}

export const updateRoleAPI = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}

export const deleteRoleAPI = (id) => {
  return request.delete(`/sys/role/${id}`)
}

export const getRoleDetailAPI = (id) => {
  return request.get(`/sys/role/${id}`)
}

export const assignPermAPI = (data) => {
  return request.put('/sys/role/assignPrem', data)
}
